x11: Handle window getting unmapped while frame still pending
authorRay Strode <rstrode@redhat.com>
Mon, 29 Jun 2020 14:21:58 +0000 (10:21 -0400)
committerRay Strode <rstrode@redhat.com>
Tue, 30 Jun 2020 18:36:07 +0000 (14:36 -0400)
commite3b5b76cdd910f990a81fbedd6462fe616ebf1cd
tree3dbdd8f4d823aa22296f93edc4f4a861d18b9b05
parent72d3a9042c107f22f8c638769ecb26c19dc985be
x11: Handle window getting unmapped while frame still pending

Since commit 972134abe48a4c9c7b6ad41b0723f30f4e7ae16b we now call
glClientWaitSync for the vendor nvidia driver, to know when a frame
is ready for the compositor to process.

If a surface is hidden while a frame is still being rendered by the GPU,
the surface will never produce the damage event the code relies on to
trigger the call to glClientWaitSync. This leaves the fence dangling,
and the next time the surface is shown, it will start a fresh frame
and blow an assertion since the fence from the last frame is still
hanging around.

This commit ensures a frame gets fully wrapped up before hiding a
surface.
gdk/x11/gdkglcontext-x11.c